// 项目中会把对应的接口请求封装成api调用
import service from "@/service";
import qs from "qs";
// 注册接口
export function getRegister(data) {
  return service({
    method: "post",
    url: "/userenter/register",
    data,
  });
}
// 登录接口
export function getLogin(data) {
  return service({
    method: "post",
    url: "/userenter/login",
    data,
  });
}
export function getLogininfo(user_name) {
  return service({
    method: "get",
    url: `/userenter/logininfo?user_name=${user_name}`,
  });
}
// 登录权限接口获取路由列表
export function getPermisson(user_roleid) {
  return service({
    method: "get",
    url: `/userenter/menu?user_roleid=${user_roleid}`,
  });
}

// 学生列表接口
export function students() {
  return service({
    method: "get",
    url: "/students/studentsInfo",
  });
}
//学生列表添加接口
export function addStudents(data) {
  return service({
    method: "post",
    url: "/students/add",
    data,
  });
}
// 学生列表查询接口
export function findStudent(params) {
  return service({
    method: "get",
    url: "/students/findStudent",
    params,
  });
}

// 学生列表删除接口
export function DelStudent(sid) {
  return service({
    method: "get",
    url: `/students/deleteStudent?sid=${sid}`,
  });
}

/**
 * 学生家庭信息列表接口
 */
export function familyInfo(params) {
  return service({
    method: "get",
    url: "/familyInfo",
    params,
  });
}
// 学生列表查询接口
export function familyInfoFind(params) {
  return service({
    method: "get",
    url: "/familyInfo/find",
    params,
  });
}
// 学生家庭信息列表修改数据接口
export function updateFamilyInfo(params) {
  return service({
    method: "get",
    url: "/familyInfo/update",
    params,
  });
}
// 学生家庭信息列表删除数据接口
export function delFamilyInfo(id) {
  return service({
    method: "get",
    url: `/familyInfo/delete?id=${id}`,
  });
}
// 学生家庭信息列表增加数据接口
export function addFamilyInfos(data) {
  return service({
    method: "post",
    url: "/familyInfo/add",
    data,
  });
}
/**
 * 课程信息列表接口
 */
export function courseList(params) {
  return service({
    method: "get",
    url: "/course",
    params,
  });
}
// 课程列表查询接口
export function courseListFind(params) {
  return service({
    method: "get",
    url: "/course/find",
    params,
  });
}
//课程列表修改数据接口
export function updatecourseList(params) {
  return service({
    method: "get",
    url: "/course/update",
    params,
  });
}
// 课程列表删除数据接口
export function delcourseList(id) {
  return service({
    method: "get",
    url: `/course/delete?id=${id}`,
  });
}
// 课程列表增加数据接口
export function addcourseList(data) {
  return service({
    method: "post",
    url: "/course/add",
    data,
  });
}

// 信息列表新增数据接口
export function info(data) {
  data = qs.stringify(data); //将对象序列化成url的形式；以&进行拼接
  return service({
    method: "post",
    url: "/info",
    data,
  });
}
// 信息列表查询接口
export function getInfo() {
  return service({
    method: "get",
    url: "/courses/coursesInfo",
  });
}
// 选课信息接口
export function SelectionCourse() {
  return service({
    method: "get",
    url: "/courses/selectionInfo",
  });
}

// 根据学生sid查看选择课程和成绩
export function findCourse(sid) {
  return service({
    method: "get",
    url: `/courses/gradeInfo?sid=${sid}`,
  });
}

// 权限接口
export function userPermission() {
  return service({
    method: "get",
    url: "/userenter/permission",
  });
}
// 父级菜单接口
export function parentMenu() {
  return service({
    method: "get",
    url: "/userenter/parentmenu",
  });
}

//毕业生列表接口
export function graduate(params) {
  return service({
    method: "get",
    url: "/graduates/graduate",
    params, //所传的数据
  });
}

//毕业生查询接口

export function graduateFind(name) {
  return service({
    method: "get",
    url: `/graduates/graduateFind?name=${name}`,
    name, //所传的数据
  });
}

//毕业生信息删除接口
export function graduateDel(id) {
  return service({
    method: "get",
    url: `/graduates/graduateDel?id=${id}`,
  });
}

//毕业生新增信息接口
export function graduateInfo(data) {
  data = qs.stringify(data); //将对象序列化成url的形式；以&进行拼接
  return service({
    method: "post",
    url: "/graduates/graduateInfo",
    data,
  });
}
//毕业生修改信息接口
export function graduateEdit(data) {
  data = qs.stringify(data); //将对象序列化成url的形式；以&进行拼接
  return service({
    method: "post",
    url: "/graduates/graduateEdit",
    data,
  });
}

// 旅游地图接口
export function travel() {
  return service({
    method: "get",
    url: "/travel",
  });
}

//学生就业分布-中国地图、-------hrr
export function China() {
  return service({
    method: "get",
    url: "/graduateMap/graduate3",
  });
}

//学生就业分布-城市地图
export function City() {
  return service({
    method: "get",
    url: "/graduateMap/graduate4",
  });
}

//学生薪资分布--圆环图
export function Salary() {
  return service({
    method: "get",
    url: "/graduateMap/graduate5",
  });
}
//柱状图
export function Major() {
  return service({
    method: "get",
    url: "/graduateMap/graduate6",
  });
}
//城市信息
export function Cityinfo(params) {
  return service({
    method: "get",
    url: "/graduateMap/graduateCityinfo",
    params,
  });
}
//毕业生信息
export function Graduate() {
  return service({
    method: "get",
    url: "/graduateMap/graduate",
  });
}

//毕业生信息查询
export function Graduatefind(params) {
  return service({
    method: "get",
    url: "/graduatefind",
    params,
  });
}

//毕业生信息删除
export function Graduatedel(params) {
  return service({
    method: "get",
    url: "/graduatedel",
    params,
  });
}

//毕业生信息增加
export function Graduateadd(data) {
  return service({
    method: "post",
    url: "/graduateadd",
    data,
  });
}
//毕业生信息修改
export function Graduateupdate(params) {
  return service({
    method: "get",
    url: "/graduateUpdate",
    params,
  });
}

//课程信息
export function Course() {
  return service({
    method: "get",
    url: "/courseInfo",
  });
}

//课程信息查询
export function Coursefind(params) {
  return service({
    method: "get",
    url: "/course/coursefind",
    params,
  });
}
//学生选课
export function Courseselect(params) {
  return service({
    method: "get",
    url: "/course/courseselect",
    params,
  });
}
//查询学生选课信息
export function Usestucourse(params) {
  return service({
    method: "get",
    url: "/course/usestucourse",
    params,
  });
}
//改变课程数量
export function ChangeCoursecount(params) {
  return service({
    method: "get",
    url: "/course/coursecount",
    params,
  });
}
//改变课程按钮状态
export function ChangeCoursestate(params) {
  return service({
    method: "get",
    url: "/course/coursestate",
    params,
  });
}

// 登录接口
// export function Login(data) {
//     return service({
//         method: 'post',
//         url: '/login',
//         data
//     })
// }

// 获取用户信息
export function getuser() {
  return service({
    method: "get",
    url: "/userenter/userinfo",
  });
}

//获取学生具体信息
export function getPersonInfo(params) {
  return service({
    method: "get",
    url: "/course/personinfo",
    params,
  });
}
